﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using SYHParamter;
using SYH178Model;
using System.Data;
using SYH178DAL;
using UtilityLibrary.Paramater;

namespace SYHWeb.Controllers
{
    public class ComapnyNameByIdController : InterFaceController<ComapnyNameByIdRequest, ComapnyNameByIdResponse>
    {
        //
        // GET: /ComapnyNameById/

        protected override string DoInvoke(ComapnyNameByIdRequest requestParamater, ComapnyNameByIdResponse responseParamater)
        {
            SYH178DAL.Company_Info adapter = new SYH178DAL.Company_Info();
            DataTable dt = adapter.GetComapnyNameById(requestParamater.Id);
            IList<SYH178Model.Company_Info> List = CommonHelp.Table2List<SYH178Model.Company_Info>(dt);

            responseParamater.List = List;
            responseParamater.SetSuccess(ProjectKey);
            return responseParamater.ToJson();
        }

        protected override ActionResult DoDebug()
        {
            ComapnyNameByIdRequest pvRpter = new ComapnyNameByIdRequest();
            pvRpter.SetProject("888888", "OOOOOOOOOOOO");
            pvRpter.Id = 217939;
            return Content(pvRpter.Html);
        }

    }
}
